/**
 * Information class for the loans
 */
package ModelLayer;
import java.util.ArrayList;
public class Loan
{
    private long id;
    private String borrowDate;
    private String period;
    private Copy copy;
    
    /**
     * Constructor for objects of class Loan
     */
    public Loan(long id, String borrowDate, String period, Copy copy)
    {
        this.id = id;
        this.borrowDate = borrowDate;
        this.period = period;
        this.copy = copy;
    }
    
    /**
     * This will set the ID for the loan.
     */
    public void setId(long inId)
    {
        id = inId;
    }
    
    /**
     * This will set the borrow date for the loan.
     */
    public void setBorrowDate(String inBorrowDate)
    {
        borrowDate = inBorrowDate;
    }
    
    /**
     * This will set the period for the loan.
     */
    public void setPeriod(String inPeriod)
    {
        period = inPeriod;
    }
    
    /**
     * This will return the ID of a loan.
     */
    public long getId()
    {
        return id;
    }
    
    /**
     * This will return the borrow date of a loan.
     */
    public String getBorrowDate()
    {
        return borrowDate;
    }
    
    /**
     * This will return the period of a loan.
     */
    public String getPeriod()
    {
        return period;
    }
    
    /**
     * This will print out the information about a loan.
     */
    public void printOut()
    {
        System.out.println("ID:\t\t\t" + id);
        System.out.println("Borrowed:\t\t" + borrowDate);
        System.out.println("Period:\t\t\t" + period + "\n");
        
    }
    
    /**
     * This will make a copy available.
     */
    public void makeAvailable()
    {
        copy.returnCopy();
    }
    
    /**
     * This will make a copy unavailable.
     */
    public void makeUnavailable()
    {
        copy.lendCopy();
    }
}
